﻿using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace ThresholdAssistant.WebAPI.Models
{
    public class AddRecordParam
    {
        /// <summary>
        /// 分组Id
        /// </summary>
        [JsonProperty("group_id"), JsonPropertyName("group_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.GroupIdIsNull))]
        public long GroupId { get; set; }

        /// <summary>
        /// 数据组Id
        /// </summary>
        [JsonProperty("site_id"), JsonPropertyName("site_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.SiteIdIsNull))] 
        public long SiteId { get; set; }

        /// <summary>
        /// 标签Id
        /// </summary>
        [JsonProperty("tag_id"), JsonPropertyName("tag_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.TagIdIsNull))]
        public long TagId { get; set; }

        /// <summary>
        /// 数据值
        /// </summary>
        [JsonProperty("data_value"), JsonPropertyName("data_value")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.DataValueIsNull))]
        public double DataValue { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        [JsonProperty("member_id"), JsonPropertyName("member_id")]
        [Required(ErrorMessage = nameof(ErrorResultEnum.MemberIdIsNull))]
        public long MemberId { get; set; }
    }
}
